let address = "http://127.0.0.1:888"


//二级菜单
let toplist1 = $(".top-banner1").appendTo($(".man"))
let toplist2 = $(".top-banner2").appendTo($(".woman"))
let toplist3 = $(".top-banner3").appendTo($(".children"))
let toplist4 = $(".top-banner4").appendTo($(".type"))
let toplist5 = $(".top-banner5").appendTo($(".common"))
    //男子二级菜单
$(".man").mouseover(function() {
    $(".top-banner1").show()
})
$(".man").mouseleave(function() {
        $(".top-banner1").hide()
    })
    //女子二级菜单
$(".woman").mouseover(function() {
    $(".top-banner2").show()
})
$(".woman").mouseleave(function() {
        $(".top-banner2").hide()
    })
    //儿童二级菜单
$(".children").mouseover(function() {
    $(".top-banner3").show()
})
$(".children").mouseleave(function() {
        $(".top-banner3").hide()
    })
    //系列二级菜单
$(".type").mouseover(function() {
    $(".top-banner4").show()
})
$(".type").mouseleave(function() {
        $(".top-banner4").hide()
    })
    //同款二级菜单
$(".common").mouseover(function() {
    $(".top-banner5").show()
})
$(".common").mouseleave(function() {
        $(".top-banner5").hide()
    })
    //微信二维码
$(".wechat").mouseenter(function() {
    $(".code").show()
})
$(".wechat").mouseleave(function() {
    $(".code").hide()
})


$(".woman").click(function() {
    location.href = `${address}/goodsdetail.html`
})
$(".man").click(function() {
    location.href = `${address}/goodsdetail.html`
})
$(".children").click(function() {
    location.href = `${address}/goodsdetail.html`
})
$(".newgood").click(function() {
    location.href = `${address}/goodsdetail.html`
})
$(".type").click(function() {
    location.href = `${address}/goodsdetail.html`
})
$(".common").click(function() {
    location.href = `${address}/goodsdetail.html`
})

$(".gocenter").click(function() {
    location.href = `${address}/login.html`
})
$(".trycenter").click(function() {
    location.href = `${address}/register.html`
})

$(".SKECHER").click(function() {
    location.href = `${address}/host.html`
})

$(".top-shop").click(function() {
    location.href = `${address}/cartlist.html`
})
String.prototype.parseUrl = function() {
    let arr = this.slice(this.indexOf("?") + 1).split("&");
    let result = {}
    arr.forEach(item => {
        let key = item.split("=")[0];
        let value = item.split("=")[1];

        result[key] = value;
    })
    return result;
}